<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>支付</title>
    <script src="../vue.js"></script>
    <script src="axios.js"></script>
    <script src="../MD5.js"></script>
</head>
<body style="background-color: rgba(239,239,239,0.39)">
<div id="app">
    <div v-html="html" ref="alipayWap"></div>
</div>
</body>
<script>
 new Vue({
    el: '#app',
    data(){
      return{
        html:''
      }
    },
    methods:{
      fetchVideoPay(){
        let params={
          type: '1'
        };
        axios.get('/process/payment.php?act=pay',{params:params}).then(data =>{
                console.log(data.data)
                let { msg, code} = data.data
                    if (code !== 200) {
                    
                    } else {
                        data=data.data.data
                        this.html = data.pay_payload
                        this.$nextTick(() => {
                          this.$refs.alipayWap.children[0].submit()
                        })
                    }
                }).catch(function (error) {
                console.log(error); 
            })
      }
    },
    mounted(){
      this.fetchVideoPay()
    }
})       
</script>
</html>